package com.bjpowernode.boss.web.model.response;

import com.bjpowernode.enums.RespCode;
import lombok.Data;

@Data
public class Result {
    private Integer code;
    private String msg;
    private Object data;

    public static Result success(Object data) {
        Result result = new Result();
        result.setCode(RespCode.OK.getCode());
        result.setMsg(RespCode.OK.getMsg());
        result.setData(data);
        return result;
    }

    public static Result fail(RespCode respCode) {
        Result result = new Result();
        result.setCode(respCode.getCode());
        result.setMsg(respCode.getMsg());
        result.setData("");
        return result;
    }
}
